import pygame, sys, math, random

class HealthPack():
    def __init__(self, speed = [300,300], size = [300,300], pos = (500,500)):
        self.type = "HealthPack"
        self.image = pygame.image.load("RSC/balls/BlueBall.png")
        self.image = pygame.transform.scale(self.image, size)
        self.rect = self.image.get_rect()
        self.speedx = speed[0]
        self.speedy = speed[1]
        self.speed = [self.speedx, self.speedy]
        self.radius = self.rect.width/5
        self.place(pos)
        self.living = True
        
    def place(self, pos):
        self.rect.center = pos
        
    def update(self):
        self.move()
        
    def move(self):
        self.speed = [self.speedx, self.speedy]
        self.rect = self.rect.move(self.speed)
    
    def collideWall(self, width, height):
        if self.rect.left < 0 or self.rect.right > width:
            self.living = False
        if self.rect.bottom > height:
            self.living = False
    